const service = require('../utils/request').service;

function getSessionKey(data) {
  return service({
    url: '/sns/jscode2session',
    method: 'get',
    params: data
  })
}
//获取凭证
function getToken(data) {
  return service({
    url: '/cgi-bin/token',
    method: 'get',
    params: data
  })
}

function getPhone(data,token) {
  return service({
    url: '/wxa/business/getuserphonenumber?access_token='+token,
    method: 'post',
    data
  })
}

function checkSessionKey(data){
  return service({
    url: '/wxa/checksession',
    method: 'get',
    params:data
  })
}

module.exports = {
  getSessionKey,
  getToken,
  getPhone,
  checkSessionKey
};